package com.cardbaobao.cardbabyclient.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.cardbaobao.cardbabyclient.R;
import com.cardbaobao.cardbabyclient.ui.adapter.base.CommonAdapter;
import com.cardbaobao.cardbabyclient.ui.adapter.base.ViewHolder;
import com.cardbaobao.cardbabyclient.model.SpeedCardTag;

import java.util.List;

/**
 * Description:
 * Created by FHW
 * on 2017/6/20
 */

public class BankScreenAdapter extends CommonAdapter<SpeedCardTag.BankListBean> {

    public BankScreenAdapter(Context mContext, List<SpeedCardTag.BankListBean> mData, int mItemLayoutId) {
        super(mContext, mData, mItemLayoutId);
    }

    @Override
    public void convert(ViewHolder holder, SpeedCardTag.BankListBean item, int position) {
        RelativeLayout rl_screen = holder.getView(R.id.rl_screen);
        ImageView iv_choose = holder.getView(R.id.iv_choose);
        TextView tv_name = holder.getView(R.id.tv_name);
        holder.setText(R.id.tv_name, item.getNameShort());
        if (item.isChoose()) {
            rl_screen.setBackgroundResource(R.drawable.tv_bg_line_ff9e27_34px);
            tv_name.setTextColor(mContext.getResources().getColor(R.color.color_FF9E27));
            iv_choose.setVisibility(View.VISIBLE);
        } else {
            rl_screen.setBackgroundResource(R.drawable.tv_bg_line_eee_34px);
            tv_name.setTextColor(mContext.getResources().getColor(R.color.color_222222));
            iv_choose.setVisibility(View.INVISIBLE);
        }
    }
}
